CREATE TABLE [dbo].[TDCOMP_RETE]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[NU_COMP_RETE] [dbo].[TD_VC_020] NOT NULL,
[NU_SECU] [dbo].[TD_IN_001] NOT NULL CONSTRAINT [DF__TDCOMP_RE__NU_SE__2665ABE1] DEFAULT ((0)),
[TI_DOCU] [dbo].[TD_VC_003] NOT NULL,
[NU_DOCU] [dbo].[TD_VC_020] NOT NULL,
[FE_EMIS] [dbo].[TD_DT_001] NOT NULL,
[IM_TOTA_CONV] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDCOMP_RE__IM_TO__2759D01A] DEFAULT ((0)),
[IM_RETE_CONV] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDCOMP_RE__IM_RE__284DF453] DEFAULT ((0)),
[IM_PAGO_CONV] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCOMP_RE__IM_PA__2942188C] DEFAULT ((0)),
[IM_COMP_PAGO] [dbo].[TD_NU_016_004] NULL CONSTRAINT [DF__TDCOMP_RE__IM_CO__2A363CC5] DEFAULT ((0)),
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDCOMP_RE__CO_US__2B2A60FE] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDCOMP_RE__FE_US__2C1E8537] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TDCOMP_RE__CO_US__2D12A970] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TDCOMP_RE__FE_US__2E06CDA9] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDCOMP_RETE] ADD CONSTRAINT [PK__TDCOMP_R__01C4F6C126E59A25] PRIMARY KEY CLUSTERED  ([CO_EMPR], [NU_COMP_RETE], [NU_SECU]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDCOMP_RETE] ADD CONSTRAINT [FK__TDCOMP_RETE__3BCBA872] FOREIGN KEY ([CO_EMPR], [NU_COMP_RETE]) REFERENCES [dbo].[TCCOMP_RETE] ([CO_EMPR], [NU_COMP_RETE])
GO
